#ifndef TABEL_H
#define TABEL_H

#include <QMainWindow>
#include "qcustomplot.h"

class Tabel : public QMainWindow
{
    Q_OBJECT
public:
    explicit Tabel(QWidget *parent = nullptr);
    void addDataPoint(double time, double temp, double hum, double illum);

private:
    QCustomPlot *customPlot;
    QCPGraph *tempGraph;    // 温度曲线
    QCPGraph *humGraph;     // 湿度曲线
    QCPGraph *illumGraph;   // 光照曲线

    // 数据存储容器
    QVector<double> timeData;
    QVector<double> tempData;
    QVector<double> humData;
    QVector<double> illumData;

    // 坐标轴范围跟踪
    double maxTime = 60;    // 默认显示60秒
    double maxTemp = 40;    // 温度上限(℃)
    double maxHum = 100;    // 湿度上限(%)
    double maxIllum = 1000; // 光照上限(Lux)
};

#endif // TABEL_H
